/**
 * FileName: HeapDemo
 * Author:   powersi
 * Date:     2021/1/8 16:39
 * Description: heap
 */
package com.zm.demo.core.leetcode.heap;

/**
 * Description: heap
 * Author:      powersi
 * Date:        2021/1/8 16:39
 */
public class DynamicHeapDemo {

    public static void main(String[] args) {
        DynamicHeap maxHeap = buildMaxHeap();
        DynamicHeap minHeap = buildMinHeap();
        System.out.println(maxHeap);
        System.out.println(minHeap);

        maxHeap.delete1(1);
        System.out.println(maxHeap);

//        maxHeap.delete1(1);
    }


    public static DynamicHeap buildMaxHeap(){
        DynamicHeap heap = new DynamicHeap(10);
        for (int i = 0; i < 15 ; i++) {
            heap.insertMaxHeap(i);
        }
        return heap;
    }

    public static DynamicHeap buildMinHeap(){
        DynamicHeap heap = new DynamicHeap(10);
        for (int i = 15; i > 0 ; i--) {
            heap.insertMinHeap(i);
        }
        return heap;
    }

}
